#pragma once
#include "Character.h"
#include "Sprite.h"
#include "Utils.h"
#include "GlobalVariables.h"
#include "Gun.h"
#include "String"
#include "stdio.h"

#define MAX_ENEMY_RED 7
#define MAX_ENEMY_RED_FOREST 2

class CEnemyRed : public  CCharacter
{
protected:

	D3DXVECTOR2 _ContraPosition;
	DWORD frame_start_red;
	DWORD tick_per_frame;

	int red_enemy_count; // count enemy red to set position Y
	int index_enemy_forest; 
	int count_time_enemy_up ;
	bool _isForestUp ;
	D3DXVECTOR2 _EnemyRedPosition;
	int count_time_enemy_change ;
	int EnemyRed_Position[2][7];
	
	int temp_add_position;

	CSprite * _EnemyRed[MAX_ENEMY_RED];
	CSprite * _EnemyRedForest[MAX_ENEMY_RED_FOREST];

	//Enemy Status

	bool _isRight;
	bool _isJump;
	bool _isLeft;
	int _isDown;
	bool _isRightDown;

	// bullet
	CSprite *_sprite_bullet;
	CBullet *_bullet;
	CGun _listbullet;
	bool _isbullet;
	bool _gun;
	DWORD _gun_start;
	DWORD _tick_per_gun;
	DWORD _bullet_start;
	DWORD _tick_bullet;
	int _levelBullet;

	
public:
	CEnemyRed();

	void ReadPosition(char *path);
	void LoadResource(LPDIRECT3DDEVICE9 d3ddv, LPD3DXSPRITE &SpriteHandler, HINSTANCE hInstance, HWND hWnd);
	void EnemyRedGun();
	void Update(D3DXVECTOR2 ContraPositon);
	void Render(D3DXVECTOR2 ContraPositon);
	~CEnemyRed();
};

